﻿<%@ Page Language="C#" MasterPageFile="~/MasterPages/MasterPage.master" AutoEventWireup="true" CodeFile="LegsPriceHistory.aspx.cs" Inherits="Items_ItemsPriceHistory" Title="История на цените" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style2
        {
            height: 232px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

    <table class="style1">
        <tr>
            <td>
                История на цените на Крака<br />
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate>
                        Търсене по Код:
                        <asp:TextBox ID="txtSearchByCode" runat="server"></asp:TextBox>
                        &nbsp;<asp:Button ID="btnSearchByCode" runat="server" onclick="btnSearchByCode_Click" 
                    Text="Търси" />
                        <asp:GridView ID="gvItems" runat="server" AllowPaging="True" 
                            AllowSorting="True" AutoGenerateColumns="False" BackColor="White" 
                            BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="4" 
                            DataKeyNames="LegID" DataSourceID="sdsItems" ForeColor="Black" 
                            GridLines="Horizontal" style="text-align: left">
                            <FooterStyle BackColor="#CCCC99" ForeColor="Black" />
                            <Columns>
                                <asp:CommandField SelectText="История" ShowSelectButton="True" />
                                <asp:BoundField DataField="Code" HeaderText="Код" SortExpression="Code" />
                                <asp:BoundField DataField="NameBG" HeaderText="Име БГ" 
                                    SortExpression="NameBG" />
                                <asp:BoundField DataField="NameEN" HeaderText="Име АН" 
                                    SortExpression="NameEN" />
                                <asp:BoundField DataField="EXW1" DataFormatString="{0:f}" 
                                    HeaderText="EXW в ЛВ без обков" SortExpression="EXW1" />
                                <asp:BoundField DataField="EXW2" DataFormatString="{0:f}" 
                                    HeaderText="EXW цена на обкова в ЛВ" SortExpression="EXW2" />
                                <asp:BoundField DataField="EXW3" DataFormatString="{0:f}" 
                                    HeaderText="EXW цена в ЛВ с обков" SortExpression="EXW3" />
                                <asp:BoundField DataField="DDU1_EUR" DataFormatString="{0:f}" 
                                    HeaderText="DDU цена в EUR без обков" SortExpression="DDU1_EUR" />
                                <asp:BoundField DataField="DDU2_EUR" DataFormatString="{0:f}" 
                                    HeaderText="DDU цена на обкова в EUR" SortExpression="DDU2_EUR" />
                                <asp:BoundField DataField="DDUEUR" DataFormatString="{0:f}" 
                                    HeaderText="DDU цена с обков в EUR" SortExpression="DDUEUR" />
                                <asp:BoundField DataField="DDUBGN" DataFormatString="{0:f}" 
                                    HeaderText="DDU цена с обков в ЛВ" SortExpression="DDUBGN" />
                                <asp:BoundField DataField="Count1" HeaderText="Бр. в комплект" 
                                    SortExpression="Count1" />
                                <asp:BoundField DataField="Count2" HeaderText="Комплекти в кашон" 
                                    SortExpression="Count2" />
                                <asp:BoundField DataField="Count3" HeaderText="Кашон в пакет" 
                                    SortExpression="Count3" />
                                <asp:BoundField DataField="Count4" HeaderText="Комплекти в палет" 
                                    SortExpression="Count4" />
                            </Columns>
                            <PagerStyle BackColor="White" ForeColor="Black" HorizontalAlign="Right" />
                            <SelectedRowStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
                            <HeaderStyle BackColor="#333333" Font-Bold="True" ForeColor="White" />
                        </asp:GridView>
                        <br />
                        <br />
                        ИСТОРИЯ<asp:GridView ID="gvPriceHistory" runat="server" AllowPaging="True" 
                            AutoGenerateColumns="False" BackColor="White" BorderColor="#DEDFDE" 
                            BorderStyle="None" BorderWidth="1px" CellPadding="4" 
                            DataSourceID="sdsPriceHistory" ForeColor="Black" GridLines="Vertical" 
                            onselectedindexchanged="gvPriceHistory_SelectedIndexChanged" PageSize="15">
                            <FooterStyle BackColor="#CCCC99" />
                            <RowStyle BackColor="#F7F7DE" />
                            <Columns>
                                <asp:BoundField DataField="LegID" HeaderText="Код на продукта" 
                                    SortExpression="LegID" />
                                <asp:BoundField DataField="EXW1" DataFormatString="{0:f}" 
                                    HeaderText="EXW в ЛВ без обков" SortExpression="EXW1" />
                                <asp:BoundField DataField="EXW2" DataFormatString="{0:f}" 
                                    HeaderText="EXW цена на обкова в ЛВ" SortExpression="EXW2" />
                                <asp:BoundField DataField="EXW3" DataFormatString="{0:f}" 
                                    HeaderText="EXW цена в ЛВ с обков" SortExpression="EXW3" />
                                <asp:BoundField DataField="DDU1_EUR" DataFormatString="{0:f}" 
                                    HeaderText="DDU цена в EUR без обков" SortExpression="DDU1_EUR" />
                                <asp:BoundField DataField="DDU2_EUR" DataFormatString="{0:f}" 
                                    HeaderText="DDU цена на обкова в EUR" SortExpression="DDU2_EUR" />
                                <asp:BoundField DataField="DDUEUR" DataFormatString="{0:f}" 
                                    HeaderText="DDU цева с обкова в EUR" SortExpression="DDUEUR" />
                                <asp:BoundField DataField="DDUBGN" DataFormatString="{0:f}" 
                                    HeaderText="DDU цена с обкова в ЛВ" SortExpression="DDUBGN" />
                                <asp:BoundField DataField="Count1" HeaderText="Бр в Комплект" 
                                    SortExpression="Count1" />
                                <asp:BoundField DataField="Count2" HeaderText="Комплект Кашон" 
                                    SortExpression="Count2" />
                                <asp:BoundField DataField="Count3" HeaderText="Кашон в Палет" 
                                    SortExpression="Count3" />
                                <asp:BoundField DataField="Date" HeaderText="Дата на промяна" 
                                    SortExpression="Date" />
                            </Columns>
                            <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
                            <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
                            <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
                            <AlternatingRowStyle BackColor="White" />
                        </asp:GridView>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
        </tr>
        <tr>
            <td class="style2">
                &nbsp;</td>
        </tr>
    </table>
    <br />
    <p>
     <asp:SqlDataSource ID="sdsItems" runat="server" 
            ConnectionString="<%$ ConnectionStrings:KonturConnectionString %>" 
            SelectCommand="SELECT [LegID], [Code], [NameBG], [NameEN], [EXW1], [EXW2], [EXW3], [DDU1_EUR], [DDU2_EUR], [DDUEUR], [DDUBGN], [Count1], [Count2], [Count3], [Count4], [Weight] FROM [Legs]"></asp:SqlDataSource>
    </p>
    <p>
        <asp:SqlDataSource ID="sdsPriceHistory" runat="server" 
            ConnectionString="<%$ ConnectionStrings:KonturConnectionString %>" 
 
            SelectCommand="SELECT [PriceHistoryID], [LegID], [Date], [EXW1], [EXW2], [EXW3], [DDU1_EUR], [DDU2_EUR], [DDUEUR], [DDUBGN], [Count1], [Count2], [Count3], [Count4], [Weight] FROM [PriceHistoryLegs] WHERE ([LegID] = @LegID)">
            <SelectParameters>
                <asp:ControlParameter ControlID="gvItems" Name="LegID" 
                    PropertyName="SelectedValue" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
    </p>
            </td>
        </tr>
        <tr>
            <td>
     
</asp:Content>

